<template>
  <div class="win">
    <noData v-if="goodsData==''"></noData>
    <div v-else>
      <div class="goods_box">
        <goods :goodsData="item" v-for="(item, index) in goodsData" :key="index" @goodsCk="addCar" />
      </div>
      <p class="bottom_word">到底了~</p>
    </div>

    <i-toast id="toast" />
  </div>
</template>

<script>
import noData from "@/components/noData";
export default {
  data() {
    return {
      bjurl: "",
      goodsData: []
    };
  },
  methods: {
    // 请求接口我的收藏列表
    getCollectList() {
      this.$ajax("/home/mine/me_collection", "post", {})
        .then(res => {
          
          if (res.status) {
            this.goodsData = res.data;
          } else {
            this.goodsData = "";
          }
        })
        .catch(err => {});
    }
  },
  components: {
    noData
  },
  onShow() {
    this.getCollectList();
  },
  onLoad(e) {
    Object.assign(this.$data, this.$options.data());
    this.bjurl = this.$bjurl;
  }
};
</script>

<style lang="scss" scoped>
.win {
  .goods_box {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 30rpx;
  }
  .bottom_word {
    text-align: center;
    margin-top: 58rpx;
    color: #999999;
    font-size: 30rpx;
    padding-bottom: 60rpx;
  }
}
</style>
